package com.redis.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liyanhao
 * @Date 2023-02-13 23:06
 */
@RestController
@Slf4j
public class IndexControler {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @RequestMapping("/test_cluster")
    public void testCluster(){
        stringRedisTemplate.opsForValue().set("name", "zhansan");
        System.out.println(stringRedisTemplate.opsForValue().get("name"));
    }
}
